/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pos.system;

import java.awt.event.ItemEvent;
import java.text.DecimalFormat;
import java.text.NumberFormat;

/**
 *
 * @author Shameera
 */
public class StockItem {

    private String code;
    private String name;
    private String seller;
    private int qty;
    private double unit_price;
    NumberFormat moneyFormat = new DecimalFormat("###.00");

    public StockItem(String code, String name, String seller, int qty, double unit_price) {
        this.code = code;
        this.name = name;
        this.seller = seller;
        this.qty = qty;
        this.unit_price = unit_price;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getSeller() {
        return seller;
    }

    public int getQty() {
        return qty;
    }

    public double getUnit_price() {
        return unit_price;
    }

    public String getQtyAsString() {
        return "" + qty;
    }

//    public String getUnit_priceAsString(){
//        return ""+unit_price;
//    }
//    
    public String getUnit_priceAsMoneyString() {
        return moneyFormat.format(unit_price);
    }

    @Override
    public String toString() {
        return "" + "CODE : " + code
                + ", " + "NAME : " + code
                + ", " + "SELLER : " + code
                + ", " + "QTY : " + code
                + ", " + "UNIT_PRICE : " + code;
    }
}
